<?php
namespace app\admin\logic;

class User extends BaseLogic
{
    /**
     * 根据用户名查询登录账号信息
     * @param $username
     */
    function findAdminByName($username)
    {
        return model('Admin')->where(['user_name' => $username])->find();
    }

    /**
     * 添加管理员
     * @param $data
     * @return int|string
     */
    function createAdmin($data){
        return model('Admin')->insert($data);
    }
}